# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.tools.libtool import LibtoolLibrary

class Recipe(recipe.Recipe):
    name = 'bzip2'
    version = '1.0.6'
    licenses = [{License.BSD_like: ['LICENSE']}]
    stype = SourceType.TARBALL
    btype = BuildType.MESON
    # bzip2.org is dead
    #url = 'https://bzip.org/%(version)s/bzip2-%(version)s.tar.gz'
    url = 'https://gstreamer.freedesktop.org/src/mirror/bzip2-%(version)s.tar.gz'
    tarball_checksum = 'a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd'

    patches = [name + '/add-meson-build-files.patch']

    files_libs = ['libbz2']
    files_devel = ['include/bzlib.h', 'lib/pkgconfig/bzip2.pc']

    def post_install(self):
        libtool_la = LibtoolLibrary('bz2', 1, 0, 6, self.config.libdir,
                self.config.target_platform)
        libtool_la.save()
        super().post_install()
